﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Itfort
{
	/// <summary>
	/// 缓存操作接口
	/// </summary>
	public interface ICache
	{
		/// <summary>
		/// 获取缓存值。
		/// </summary>
		/// <param name="key"></param>
		/// <returns></returns>
		Object Get(String key);

		/// <summary>
		/// 设置缓存值。
		/// </summary>
		/// <param name="key"></param>
		/// <param name="value"></param>
		void Set(String key, Object value);

		/// <summary>
		/// 设置缓存值。
		/// </summary>
		/// <param name="key"></param>
		/// <param name="value"></param>
		/// <param name="duration"></param>
		void Set(String key, Object value, TimeSpan duration);

		/// <summary>
		/// 移除缓存。
		/// </summary>
		/// <param name="key"></param>
		void Remove(String key);
	}
}
